package com.example.demomk.entity;

import androidx.room.ColumnInfo;
import androidx.room.Entity;
import androidx.room.PrimaryKey;

@Entity(tableName = "avg_measurements")
public class AvgMeasurement {
    @PrimaryKey(autoGenerate = true)
    private int id;

    @ColumnInfo(name = "user_id")
    private int userId;

    @ColumnInfo(name = "location_id")
    private int locationId;

    @ColumnInfo(name = "start_time")
    private String startTime; // 如"2025-05-06 16:56:20"
    @ColumnInfo(name = "flow", defaultValue = "0.0")
    private Double flow; // 使用包装类型 Double，允许 null
    //新增方法
    @ColumnInfo(name = "means")
    private String means;
    //新增法规
    @ColumnInfo(name = "laws")
    private String laws;
    private String extra1;
    private String extra2;
    private String extra3;




    public AvgMeasurement(int userId, int locationId, String startTime, Double flow, String means, String laws) {
        this.userId = userId;
        this.locationId = locationId;
        this.startTime = startTime;
        this.flow = flow;
        this.means = means;
        this.laws = laws;
    }

    public double getFlow() {
        return flow;
    }

    public void setFlow(double flow) {
        this.flow = flow;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getUserId() {
        return userId;
    }

    public void setUserId(int userId) {
        this.userId = userId;
    }

    public int getLocationId() {
        return locationId;
    }

    public void setLocationId(int locationId) {
        this.locationId = locationId;
    }

    public String getStartTime() {
        return startTime;
    }

    public void setStartTime(String startTime) {
        this.startTime = startTime;
    }

    public void setFlow(Double flow) {
        this.flow = flow;
    }

    public String getMeans() {
        return means;
    }

    public void setMeans(String means) {
        this.means = means;
    }

    public String getLaws() {
        return laws;
    }

    public void setLaws(String laws) {
        this.laws = laws;
    }

    public String getExtra1() {
        return extra1;
    }

    public void setExtra1(String extra1) {
        this.extra1 = extra1;
    }

    public String getExtra2() {
        return extra2;
    }

    public void setExtra2(String extra2) {
        this.extra2 = extra2;
    }

    public String getExtra3() {
        return extra3;
    }

    public void setExtra3(String extra3) {
        this.extra3 = extra3;
    }
}
